package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_param_group", schema = "", catalog = "onedollar")
public class TParamGroupEntity {
    private int id;
    private Integer goodsId;
    private Integer paramId;
    private String paramValues;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "goods_id", nullable = true, insertable = true, updatable = true)
    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    @Basic
    @Column(name = "param_id", nullable = true, insertable = true, updatable = true)
    public Integer getParamId() {
        return paramId;
    }

    public void setParamId(Integer paramId) {
        this.paramId = paramId;
    }

    @Basic
    @Column(name = "param_values", nullable = true, insertable = true, updatable = true, length = 300)
    public String getParamValues() {
        return paramValues;
    }

    public void setParamValues(String paramValues) {
        this.paramValues = paramValues;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TParamGroupEntity that = (TParamGroupEntity) o;

        if (id != that.id) return false;
        if (goodsId != null ? !goodsId.equals(that.goodsId) : that.goodsId != null) return false;
        if (paramId != null ? !paramId.equals(that.paramId) : that.paramId != null) return false;
        if (paramValues != null ? !paramValues.equals(that.paramValues) : that.paramValues != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (goodsId != null ? goodsId.hashCode() : 0);
        result = 31 * result + (paramId != null ? paramId.hashCode() : 0);
        result = 31 * result + (paramValues != null ? paramValues.hashCode() : 0);
        return result;
    }
}
